package cpu.footprint.util;

import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.RotateAnimation;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;

/**
 * Created by Administrator on 2017/3/11.
 */

public class AnimationUtil {
    /***
     * // 透明度控制动画效果alpha
     * @return
     */
    public static AlphaAnimation CreateAlphaAnimation(){
        AlphaAnimation animation = new AlphaAnimation(0.0f, 1.0f);
        animation.setDuration(2000);//
        return animation;
    }
    /***
     * // rotate旋转动画
     * @return
     */
    public static RotateAnimation CreateRotateAnimation(){
        RotateAnimation animation =new RotateAnimation(0.0f, +350.0f,
                Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
                0.5f);
        animation.setDuration(2000);//
        return animation;
    }
    /***
     * // 尺寸伸缩动画效果 scale
     * @return
     */
    public static ScaleAnimation CreateScaleAnimation(){
        ScaleAnimation animation =  new ScaleAnimation(0.0f, 1.4f, 0.0f, 1.4f,
                Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
                0.5f);
        animation.setDuration(2000);//
        return animation;
    }
    /***
     * // 位置转移动画效果
     * @return
     */
    public static TranslateAnimation CreateTranslateAnimation(){
        TranslateAnimation animation =new TranslateAnimation(30.0f,-80.0f, 30.0f, 300.0f);
        animation.setDuration(2000);//
        return animation;
    }
}
